[XEND] Save model attribute for HVM VIFs
authorAlastair Tse <atse@xensource.com>
Mon, 22 Jan 2007 17:31:15 +0000 (17:31 +0000)
committerAlastair Tse <atse@xensource.com>
Mon, 22 Jan 2007 17:31:15 +0000 (17:31 +0000)
This solves the problem of HVM VIFs forgetting their model config on
reboot.

http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=867

Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/server/netif.py

index bc755e9c9d9e4704bbacd3a9915d7023631a301a..ce642189832db2080c6affe5326870c07bf40e78 100644 (file)
@@ -147,6 +147,7 @@ class NetifController(DevController):
         rate    = config.get('rate')
         uuid    = config.get('uuid')
         ipaddr  = config.get('ip')
+        model   = config.get('model')
 
         devid = self.allocateDeviceID()
 
@@ -176,6 +177,8 @@ class NetifController(DevController):
             back['rate'] = parseRate(rate)
         if uuid:
             back['uuid'] = uuid
+        if model:
+            back['model'] = model
 
         return (devid, back, front)
 
@@ -185,8 +188,9 @@ class NetifController(DevController):
 
         result = DevController.getDeviceConfiguration(self, devid)
         devinfo =  self.readBackend(devid, 'script', 'ip', 'bridge',
-                                    'mac', 'type', 'vifname', 'rate', 'uuid')
-        (script, ip, bridge, mac, typ, vifname, rate, uuid) = devinfo
+                                    'mac', 'type', 'vifname', 'rate',
+                                    'uuid', 'model')
+        (script, ip, bridge, mac, typ, vifname, rate, uuid, model) = devinfo
 
         if script:
             network_script_dir = xoptions.network_script_dir + os.sep
@@ -205,6 +209,8 @@ class NetifController(DevController):
             result['rate'] = formatRate(rate)
         if uuid:
             result['uuid'] = uuid
-
+        if model:
+            result['model'] = model
+            
         return result